﻿namespace Sharemarker.Service
{
    using Sharemarker.Common.Contracts;
    using System.ServiceModel;

    using log4net;

    /// <summary>
    /// 
    /// </summary>
    [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single, AddressFilterMode = AddressFilterMode.Any)]
    public class SecurityCheckService : ISecurityCheckService
    {
        #region Static Fields

        /// <summary>
        /// 
        /// </summary>
        private static readonly ILog Logger = LogManager.GetLogger(typeof(SecurityCheckService));

        #endregion

        /// <summary>
        /// Doeses the account existed in system.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        public bool DoesAccountExistedInSystem(string username, string password)
        {
            ISharemarkerManager sharemarkerManager = SharemarkerManager.GetInstance;
            if (sharemarkerManager == null)
            {
                return false;
            }

            return sharemarkerManager.DoesAccountExistedInSystem(username, password);
        }
    }
}
